package com.david.http.http.response

import com.alibaba.fastjson.JSONArray
import com.alibaba.fastjson.JSONObject
import com.alibaba.fastjson.annotation.JSONField

/**用于retrofit返回格式固定的接口 */
class BaseResult<T> {
    constructor()
    constructor(data: T? = null, msg: String? = null, code: String? = null) {
        this.data = data
        this.msg = msg
        this.code = code
    }
    var data: T? = null //可传入data的bean
    var msg: String? = null
    var code: String? = null
}


/**
 * 直接用jsonObj接收返回结果
 */
class BaseJSONObjResult {
    @JSONField(name = "result")
    var data: JSONObject? = null //可传入data的bean
    var msg: String? = null
    var code: String? = null
}

class BaseJSONArrResult {
    @JSONField(name = "result")
    var data: JSONArray? = null //可传入data的bean
    var msg: String? = null
    var code: String? = null
}